package com.hxk.structuralMode.proxy.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class StarHander implements InvocationHandler {
	
	private Star realStar;

	public StarHander(Star realStar) {
		this.realStar = realStar;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		Object obj = null;
		if("sing".equals(method.getName())) {
			obj = method.invoke(realStar, args);
		}
		return obj;
	}

}
